<template>
	<view>

		<u-sticky offset-top="0">
			<view class="tabbox  flex-between ">
				<view class="flex-between" style="width: 70%;">
					<scroll-view scroll-x="true" style="width: 82%; white-space: nowrap;">
						<view>
							<view class="flex-a-c u-font-38">
								<view :class="index==0?'active':'def'" @click="chooses(i.name)"
									v-for="(i,index) in list1" :key="index">
									{{i.name}}
								</view>
							</view>
						</view>
					</scroll-view>
					<view class="flex-a-c u-m-r-20">
						<!-- 	
						<view class="u-m-lr-10">
							<u-line direction='col' length=20 ></u-line>
						</view> -->
						<u-icon name='plus-circle' size=23></u-icon>
					</view>
				</view>
			</view>
			<!-- <u-line></u-line> -->
			<view class="myline ">

			</view>
			<view class="threetext flex-between ">
				<view class="flex-a-c">
					<view class="u-m-r-30" @click="choose(index)" :class="current==index?'active':'threeitem'"
						v-for="(i,index) in tablist" :key="index">
						{{i}}
					</view>
				</view>
				<view class="text-999 flex-a-c" @click="$goTo('pages/index/screen')">
					<u-icon name='search' size=25></u-icon>
					<text class="u-m-l-20">筛选</text>
				</view>
			</view>
		</u-sticky>


		<!-- <view class="peoplelist  u-radius-10" v-for="i in 4" @click="$goTo('pages/friendinfo/friendinfo')"> -->
		<view class="peoplelist  u-radius-10" v-for="i in 4" @click="todetail">
			<view class="baseinfo u-m-t-30 flex-between">
				<view class="">
					<view class="flex-a-c">
						<text class="u-font-34 u-font-bold">我是帅哥</text>
						<text class="ageclass u-font-24 u-m-lr-20 u-radius-6">23岁</text>
						<image src="../../static/man.jpg" style="width: 22rpx ; height: 24rpx;" mode=""></image>
					</view>
					<view class="u-font-26 u-m-t-30">
						厨师 <text class="u-m-lr-20">|</text> 深圳
					</view>
				</view>
				<image src="../../static/logo.png" class="avatar" mode=""></image>
			</view>

			<view class="flex-a-c">
				<image src="../../static/bag.png" style="width: 35rpx; height: 35rpx;" mode=""></image>

				<text class=" u-m-tb-40 u-font-26" style="color: #666;">希望能在这里遇见好朋友</text>


			</view>
			<view class=" u-font-26 u-m-b-40 flex-a-c">
				<text class="tips u-radius-6" v-for="i in 3">
					善良
				</text>
			</view>
			<view class="u-font-24 u-m-tb-30" style="color: rgba(153, 153, 153, 1);">
				个人简介：本人一直从事厨房工作，为人正直善良，性格开朗活泼，希望在这里遇见好朋友。
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				currentlist: 0,
				tablist: ['推荐', '问专家'],
				activeStyle: {
					color: '#49C064'
				},
				list1: [{
						name: '交友',
					},
					{
						name: '购物',
					}, {
						name: '生活',
					}, {
						name: '岗位',
					}, {
						name: '家政',
					}, {
						name: '同城',
					},
				],
				page: 1
			}
		},
		onLoad() {
			console.log(this.$safeT, '重中之重');
			this.getindexlist()
		},
		methods: {
			// index/list获取首页列表信息
			getindexlist() {
				this.$api.post('/index/list', {
					page: this.page
				}).then(res => {

				})
			},
			todetail() {
				if (this.current == 0) {
					uni.navigateTo({
						url: '/pages/friendinfo/friendinfo'
					})
				} else {
					uni.navigateTo({
						url: '/pages/masterinfo/masterinfo'
					})
				}
			},
			click(e) {
				console.log(e);
			},
			choose(index) {
				this.current = index
			},
			chooses(name) {
				this.$toast('点击了' + name)
			},
		}
	}
</script>

<style lang="scss">
	.tabbox {
		background-color: #fff;
		padding: 96rpx 20rpx 30rpx;
		flex-wrap: wrap;

		.active {
			position: relative;
			color: #49C064;

			&::after {
				position: absolute;
				content: ' ';
				bottom: -10rpx;
				left: 5rpx;
				width: 46rpx;
				height: 8rpx;
				border-radius: 10rpx;
				background-color: #49C064;
			}
		}

		.def {
			margin-left: 30rpx;
		}
	}

	.active {
		color: rgba(51, 51, 51, 1);
		font-weight: bold;

	}

	.threetext {
		background-color: #fff;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
	}

	.threeitem {
		color: #999;
	}

	.peoplelist {
		padding: 30rpx 34rpx;
		width: 716rpx;
		background: #fff;
		box-sizing: border-box;
		margin: 20rpx auto;

		.baseinfo {

			.avatar {
				width: 100rpx;
				height: 100rpx;
				border-radius: 50%;
			}

			.ageclass {
				color: $uni-main-color;
				background: rgba(228, 246, 232, 1);
				padding: 5rpx 10rpx;
			}
		}

		.tips {
			color: rgba(245, 172, 54, 1);
			background: rgba(255, 244, 241, 1);
			padding: 5rpx 20rpx;

			&:nth-child(n+2) {
				margin-left: 20rpx;
			}
		}
	}
</style>